<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>Login</title>
    <meta charset="UTF-8">
</head>
<body>
<div style="margin: 20px;">
    <h3>用户登录</h3>

    <form th:action="@{/login}" method="post">
        <div>
            <label>用户名:</label>
            <input type="text" name="username" required/>
        </div>
        <div>
            <label>密&nbsp;&nbsp;码:</label>
            <input type="password" name="password" required/>
        </div>
        <div style="margin-top: 10px;">
            <button type="submit">登录</button>
            <a href="/register"><button type="button">注册</button></a>
        </div>
        <div th:if="${param.error}" style="color: red; margin-top: 10px;">
            用户名或密码错误
        </div>
    </form>
</div>
</body>
</html>
